<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="../../taglibs.jsp" %>
<script type="text/javascript">

function audit(orderId, orderState){
	
	
}

function viewLog(orderId){
	var diag = new Dialog();
	diag.Width = 850;
	diag.Height = 400;
	diag.Title = "操作记录";
	
	diag.URL = "${path}/consoleLog_logList?erpQuery.entityId="+orderId+"&erpQuery.tableName=order_model&erpQuery.optType=审核";
	diag.OKEvent = function(){
		//获得子页面的文档内容对象
		 var doc=diag.innerFrame.contentWindow;
		//alert(doc.age)
		var result = doc.audit(window.location, orderId, 2);
		if(result == "yes"){
			diag.close();
			window.location.href="${path }/orderModel_buy_checkList?erpQuery.orderState=1";
		}
	};
	
	diag.show();
}

function closeWin(){
	parentDialog.close();
}
</script>

<div class="content-right">
	<div class="content-r-pic_w">
		<div style="margin:8px auto auto 12px;margin-top:6px">
			<span class="page_title">进货审核</span>
		</div>
	</div>
	<form id="auditForm" action="${path }/orderModel_buy_auditOrder" method="post">
		<input id="orderId" type="hidden" name="orderModel.orderId" >
		<input id="orderState" type="hidden" name="orderModel.orderState" >
		<input id="note" type="hidden" name="note" >
	</form>
	<div class="content-text">
			<div class="square-o-top">
				<table width="100%" border="0" cellpadding="0" cellspacing="0"
					style="font-size:14px; font-weight:bold; font-family:"黑体";">
					<tr>
						<td height="30">企业名称:</td>
						<td class="order_show_msg"><s:property value="orderModel.supplier.name"/></td>
						<td>下单时间:</td>
						<td class="order_show_msg"><s:property value="orderModel.createTime"/></td>
						<td>下 单 人:</td>
						<td class="order_show_msg"><s:property value="orderModel.orderCreater.name"/></td>
						<td>订 单 号:</td>
						<td class="order_show_msg" colspan="2"><s:property value="orderModel.orderNum"/></td>
					</tr>
					<tr>
						<td height="30">订单类别:</td>
						<td class="order_show_msg"><e:getTxt type="orderType" value="${orderModel.orderType }"></e:getTxt></td>
						<td>订单状态:</td>
						<td class="order_show_msg"><e:getTxt type="orderState" value="${orderModel.orderState }"></e:getTxt></td>
						<td>商品总量:</td>
						<td class="order_show_msg"><s:property value="orderModel.totalNum"/></td>
						<td>订单总额:</td>
						<td class="order_show_msg"><s:property value="orderModel.totalPrice"/> 元</td>
					</tr>
				</table>
			</div>
			<!--"square-o-top"end-->
			<div class="square-order">
				<center style="text-decoration:underline;font-size:16px; font-weight:bold; font-family:"黑体";">&nbsp;&nbsp;&nbsp;&nbsp;订&nbsp;&nbsp;单&nbsp;&nbsp;明&nbsp;&nbsp;细&nbsp;&nbsp;&nbsp;&nbsp;</center>
				<br/>
				<table width="100%" border="1" cellpadding="0" cellspacing="0">
					<tr align="center"
						style="background:url(${path}/images/table_bg.gif) repeat-x;">
						<td width="20%" height="30">商品类别</td>
						<td width="20%">商品名称</td>
						<td width="20%">购买数量</td>
						<td width="20%">进货单价</td>
						<td width="20%">合计</td>
					</tr>	
					<s:iterator value="orderModel.ods" var="od">
						<tr align="center" bgcolor="#FFFFFF">
							<td height="30"><s:property value="#od.product.productType.name"/></td>
							<td><s:property value="#od.product.name"/></td>
							<td><s:property value="#od.detailNum"/></td>
							<td align="right"><s:property value="#od.detailPrice"/> 元&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
							<td align="right"><s:property value="#od.detailPrice*#od.detailNum"/> 元&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
						</tr>
					</s:iterator>
					
					
				</table>
				<br/>
				<div style="text-align: right;">
					<table width="100%">
					<tr>
						
						<td align="center">
							<input type="button" value="查看审批意见" onclick="viewLog(<s:property value="orderModel.orderId"/>)">
							
						</td>
					</tr>
				</table>
				</div>
				
			</div>
	</div>
	<div class="content-bbg"></div>
</div>
